package 文件内容操作;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:字节流 写文件
 * User: lenovo
 * Date: 2022-10-16
 * Time: 20:08
 */
public class demo2 {
    public static void main(String[] args) throws IOException {
        OutputStream outputStream = new FileOutputStream("./bbb.txt");//这里相当于打开了文件 会将文件里原有的内容删除
        outputStream.write(97);
        outputStream.write(98);
        outputStream.write(99);
        byte[] b = {100,101,102,103,104};//数组
        outputStream.write(b);//参数为数组
//        刷新缓冲区
        outputStream.flush();
        outputStream.close();//关闭文件,防止资源的泄露

    }
}
